/*
 *------------------------------------------------------------------------------
 * @File      :    ei_mai_sys.h
 * @Date      :    2021-4-8
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MADP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */

#ifndef __EI_MAI_SYS_H__
#define __EI_MAI_SYS_H__

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

#include "ei_mai_sys_define.h"

VBUF_POOL EI_MAI_SYS_CreateVbufPool(EI_MAI_VBUF_POOL_CONFIG_S *pstVbufPoolConfig, EI_CHAR *pname);
EI_S32 EI_MAI_SYS_DestroyVbufPool(VBUF_POOL pool);

EI_S32 EI_MAI_SYS_SetPoolFrameInfo(VBUF_POOL Pool, VIDEO_FRAME_INFO_S *pstFrameInfo);
EI_S32 EI_MAI_SYS_GetPoolFrameInfo(VBUF_POOL Pool, VIDEO_FRAME_INFO_S *pstFrameInfo);

EI_S32 EI_MAI_SYS_SetPoolFrameInfo(VBUF_POOL Pool, VIDEO_FRAME_INFO_S *pstFrameInfo);
EI_S32 EI_MAI_SYS_GetPoolFrameInfo(VBUF_POOL Pool, VIDEO_FRAME_INFO_S *pstFrameInfo);

EI_S32 EI_MAI_SYS_InitVbufConfig(EI_MAI_VBUF_CONFIG_S *pstVbConfig);
EI_S32 EI_MAI_SYS_ExitVbufConfig(EI_VOID);

VBUF_BUFFER EI_MAI_SYS_GetBuffer(VBUF_POOL Pool, EI_U32 u32TimeoutMs);
EI_S32 EI_MAI_SYS_PutBuffer(VBUF_BUFFER Buffer);
EI_S32 EI_MAI_SYS_GetFrameInfo(VBUF_BUFFER Buffer, VIDEO_FRAME_INFO_S *pstFrameInfo);

EI_S32 EI_MAI_SYS_MemAlloc(EI_U64 *pu64PhyAddr, EI_VOID **ppVirAddr,
	const EI_CHAR *strMb, const EI_CHAR *strZone, EI_U32 u32Len);
EI_S32 EI_MAI_SYS_MemFree(EI_U64 u64PhyAddr, EI_VOID *pVirAddr);

EI_U64 EI_MAI_SYS_Vir2Phy(EI_VOID *pVirAddr);

EI_S32 EI_MAI_Media_Init(EI_VOID);
EI_S32 EI_MAI_Media_DeInit(EI_VOID);

EI_S32 EI_MAI_Audio_Init(EI_VOID);
EI_S32 EI_MAI_Audio_DeInit(EI_VOID);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif

#endif

